/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.fh.itsbankomat.businesslogic.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author MeinLaptop
 */
@Entity
@Table(name = "TRANSAKTIONEN")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Transaktionen.findAll", query = "SELECT t FROM Transaktionen t"),
    @NamedQuery(name = "Transaktionen.findByTransaktionsid", query = "SELECT t FROM Transaktionen t WHERE t.transaktionsid = :transaktionsid"),
    @NamedQuery(name = "Transaktionen.findByTransaktionsname", query = "SELECT t FROM Transaktionen t WHERE t.transaktionsname = :transaktionsname"),
    @NamedQuery(name = "Transaktionen.findByStatus", query = "SELECT t FROM Transaktionen t WHERE t.status = :status"),
    @NamedQuery(name = "Transaktionen.findBySource", query = "SELECT t FROM Transaktionen t WHERE t.source = :source"),
    @NamedQuery(name = "Transaktionen.findByBetrag", query = "SELECT t FROM Transaktionen t WHERE t.betrag = :betrag"),
    @NamedQuery(name = "Transaktionen.findByIban", query = "SELECT t FROM Transaktionen t WHERE t.iban = :iban"),
    @NamedQuery(name = "Transaktionen.findByBic", query = "SELECT t FROM Transaktionen t WHERE t.bic = :bic"),
    @NamedQuery(name = "Transaktionen.findByMessageid", query = "SELECT t FROM Transaktionen t WHERE t.messageid = :messageid"),
    @NamedQuery(name = "Transaktionen.findByMessage", query = "SELECT t FROM Transaktionen t WHERE t.message = :message"),
    @NamedQuery(name = "Transaktionen.findByErstellt", query = "SELECT t FROM Transaktionen t WHERE t.erstellt = :erstellt")})
public class Transaktionen implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "TRANSAKTIONSID")
    private Integer transaktionsid;
    @Size(max = 10)
    @Column(name = "TRANSAKTIONSNAME")
    private String transaktionsname;
    @Size(max = 10)
    @Column(name = "STATUS")
    private String status;
    @Size(max = 10)
    @Column(name = "SOURCE")
    private String source;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "BETRAG")
    private BigDecimal betrag;
    @Size(max = 34)
    @Column(name = "IBAN")
    private String iban;
    @Size(max = 11)
    @Column(name = "BIC")
    private String bic;
    @Size(max = 10)
    @Column(name = "MESSAGEID")
    private String messageid;
    @Size(max = 50)
    @Column(name = "MESSAGE")
    private String message;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ERSTELLT")
    @Temporal(TemporalType.TIMESTAMP)
    private Date erstellt;

    public Transaktionen() {
    }

    public Transaktionen(Integer transaktionsid) {
        this.transaktionsid = transaktionsid;
    }

    public Transaktionen(Integer transaktionsid, Date erstellt) {
        this.transaktionsid = transaktionsid;
        this.erstellt = erstellt;
    }

    public Integer getTransaktionsid() {
        return transaktionsid;
    }

    public void setTransaktionsid(Integer transaktionsid) {
        this.transaktionsid = transaktionsid;
    }

    public String getTransaktionsname() {
        return transaktionsname;
    }

    public void setTransaktionsname(String transaktionsname) {
        this.transaktionsname = transaktionsname;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public BigDecimal getBetrag() {
        return betrag;
    }

    public void setBetrag(BigDecimal betrag) {
        this.betrag = betrag;
    }

    public String getIban() {
        return iban;
    }

    public void setIban(String iban) {
        this.iban = iban;
    }

    public String getBic() {
        return bic;
    }

    public void setBic(String bic) {
        this.bic = bic;
    }

    public String getMessageid() {
        return messageid;
    }

    public void setMessageid(String messageid) {
        this.messageid = messageid;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Date getErstellt() {
        return erstellt;
    }

    public void setErstellt(Date erstellt) {
        this.erstellt = erstellt;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (transaktionsid != null ? transaktionsid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Transaktionen)) {
            return false;
        }
        Transaktionen other = (Transaktionen) object;
        if ((this.transaktionsid == null && other.transaktionsid != null) || (this.transaktionsid != null && !this.transaktionsid.equals(other.transaktionsid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.fh.itsbankomat.businesslogic.model.Transaktionen[ transaktionsid=" + transaktionsid + " ]";
    }
    
}
